#include <netdb.h>
#include <string.h>
#include <stdio.h>

int main(int argc, char *argv[]) {
	/* Create Socket */
	int sock = socket(AF_INET, SOCK_STREAM, 0);
	char *target = argv[2];
 
	/* Set Target, Port and IP */
	struct sockaddr_in serveraddr;
	bzero(&serveraddr, sizeof(serveraddr));
	inet_pton(AF_INET, target, &(serveraddr.sin_addr));
	printf("aasdfasdfafasdflasfl -> %s\n", target);
	serveraddr.sin_family = AF_INET;
	serveraddr.sin_port = htons(1111);
 
	/* Create connection */
	connect(sock, (struct sockaddr*) &serveraddr, sizeof(serveraddr));
 
	/* Fill buffer */
	char buffer[2];
	buffer[0] = argv[1][0];
	buffer[1] = '\0';
 
	/* Send data */
	int bytes = send(sock , buffer, sizeof(buffer), 0);
 
	/* Print sended data */
	printf("Send: '%c' to %s\n", argv[1][0], argv[2]);
 
	/* Close connection */
	close(sock);
 
	return 0;
}
